#!/usr/bin/R --vanilla --slave -f

args <- commandArgs(trailingOnly=T)
t = read.csv(args[[1]], header=T)

# stupid: if I don't specify ylim, I don't see it
ylim <- c(0, max(t$load.ms))

png("foo.png", width=480, height=480)
plot(t$rows.153, t$load.ms, col="red", ylim=ylim)

points(t$rows.153, t$dump.ms, col="green")
title("tnet load/dump times")
dev.off()

cat("Load\n")
print(t$load.ms / t$rows.153)

cat("Dump\n")
print(t$dump.ms / t$rows.153)

print(t)

